package conson.tech.manage.coupons.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import conson.tech.manage.coupons.entity.pojo.CouponsCenter;
import conson.tech.manage.coupons.entity.vo.CouponReceiveVo;
import conson.tech.manage.coupons.entity.vo.CouponSeckillVo;
import conson.tech.manage.coupons.entity.vo.CouponsCenterVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * InterfaceName: CouponsCenterMapper
 * Description:
 * Author: ZYF
 * Date: 2020/7/20
 * Version: 1.0
 */
public interface CouponsCenterMapper extends BaseMapper<CouponsCenter> {

    /**
     * 根据类型查询优惠券配置中心
     */
    List<CouponsCenterVo> queryList(Integer couponsType);


    /**
     * 根据活动类型，查询对应的优惠券列表
     *
     * @param num     -1 限时抢（秒杀） -2 领用
     * @param newTime 当前时间
     */
    List<CouponSeckillVo> queryCouponsSeckillCenter(@Param("num") int num, @Param("newTime") String newTime);

    /**
     * 根据活动类型，查询对应的优惠券列表
     *
     * @param num     -1 限时抢（秒杀） -2 领用
     * @param newTime 当前时间
     */
    List<CouponReceiveVo> queryCouponsReceiveCenter(@Param("num") int num, @Param("newTime") String newTime);
}
